<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <p>currentTime1 {{currentTime1()}}</p>
    <p>currentTime2 {{currentTime2}}</p>

</div>

<!--导入Vue.js-->

<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

<script>

    var vm = new Vue({
        el: "#app",
        data: {
            message: "hello,zhangsan"
        },
        methods: {
            currentTime1: function () {
                return Date.now(); //返回当前一个时间戳
            }
        },
        computed: {
            currentTime2: function () {
                this.message;
                return Date.now();  //返回一个时间戳
            }
        }

    });
</script>
</body>
</html>